import config from "@/config"
import http from "@/utils/request"

export default {
    addRole: {
        url: `${config.API_URL}/platform/role/add`,
        name: "新增角色",
        post: function (platformRoleAddVo) {
            return http.post(this.url, platformRoleAddVo);
        }
    },
    delRoles: {
        url: `${config.API_URL}/platform/role/del`,
        name: "多选级联删除角色",
        delete: function (roleIds) {
            return http.delete(this.url, roleIds);
        }
    },
    editRole: {
        url: `${config.API_URL}/platform/role/edit`,
        name: "修改角色信息",
        put: function (platformRoleEditVo) {
            return http.put(this.url, platformRoleEditVo);
        }
    },
    updateRoleMenuAndDataAuth: {
        url: `${config.API_URL}/platform/role/updateRoleMenuAndDataAuth`,
        name: "修改角色权限信息",
        put: function (platformRoleAuthEditVo) {
            return http.put(this.url, platformRoleAuthEditVo);
        }
    },
    getRoleById: {
        url: `${config.API_URL}/platform/role/info`,
        name: "根据ID获取角色详情",
        get: function (roleId) {
            return http.get(this.url + "/" + roleId);
        }
    },
    pageListRole: {
        url: `${config.API_URL}/platform/role/pageList`,
        name: "分页查询角色列表",
        get: function (platformRoleQueryVo) {
            return http.get(this.url, platformRoleQueryVo);
        }
    }
}
